<?php
defined('IS_OK') or exit('Access Forbidden');
?>
<?php load::into('head'); ?>
<section class="main table">
  <article class="hint">
    <i class="fa fa-info-circle"></i>
    <p>点击“已安装”进行启用或查看本地模板，模板文件存在位置“站点根目录/system/web/theme/”，模板支持在线购买/安装，如需帮助或模板定制请联系客服！</p>
  </article>
  <div class="market">
    <div class="cut">
      <span>模板分类：</span>
      <ul>
        <li<?php if($G['get']['part']=='template'){ ?> class="on"<?php } ?>><a href="<?php echo url::mpf('template','template','init'); ?>">已安装</a></li>
      </ul>
    </div>
    <div class="filter">
      <dl>
        <dt>搜索：</dt>
        <dd>
          <FORM method="get" action="./">
            <?php echo form::input('lang',$G['get']['lang'],null,'hidden',array(),false); ?>
            <?php echo form::input('mold','template',null,'hidden',array(),false); ?>
            <?php echo form::input('part','market',null,'hidden',array(),false); ?>
            <?php echo form::input('func','init',null,'hidden',array(),false); ?>
			      <?php echo form::input('search',$G['get']['search'],null,'text',array('required','placeholder'=>'请输入行业信息搜索')); ?>
            <button class="fa fa-search"></button>
          </FORM>
        </dd>
      </dl>
    </div>
    <div class="list" names="<?php echo $data['names']; ?>">
      <ul>
	      <?php
        if($data['list']){
          foreach($data['list'] as $v){ 
        ?>
        <li>
          <aside>
            <p class="img"><img src="<?php echo $v['image']; ?>" version="<?php echo $v['version']; ?>" alt="<?php echo $v['name']; ?>" /></p>
            <p class="name"><a href="<?php echo $v['link']; ?>" target="_blank" class="name"><u class="green"><?php echo $v['name']; ?></u><?php echo $v['title']; ?> </a></p>
            <p class="btn">
              <?php if($v['name']==$G['config']['web_theme']){ ?>
              <a class="btnfa blue" href="javascript:;">
                <em class="fa fa-check-square-o" title="使用中"></em>
              </a>
              <?php }else{ ?>
              <a class="btnfa green" href="<?php echo url::mpf('template','template','modify',array('name'=>$v['name'])); ?>">
                <em class="fa fa-external-link" title="启用"></em>
              </a>
              <?php } ?>
              <a class="btnfa red delete" url="<?php echo url::mpf('template','template','delete',array('name'=>$v['name'])); ?>">
                <em class="fa fa-trash-o" title="删除"></em>
              </a>
            </p>
          </aside>
        </li>
        <?php
          }
        }
        ?>
      </ul>
    </div>
    <div class="pages">
      <?php echo html::admpages($data['pages'],$data['total']); ?>
    </div>
  </div>
</section>
<?php load::into('foot'); ?>